package com.yang.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.stereotype.Component;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by 杨天可 on 2022/3/29 10:54
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@Table(name = "sys_user")
public class SysUser implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @Column(name = "username")
    private String username;

    @Column(name = "sex")
    private String sex;

    @Column(name = "email")
    private String email;

    @Column(name = "phone")
    private String phone;

    @Column(name = "password")
    private String password;

    @Column(name = "shop_logo")
    private String shopLogo;

    @Column(name = "shop_name")
    private String shopName;

    @Column(name = "shop_address")
    private String shopAddress;

    @Column(name = "QR_url")
    private String qrUrl;

    @Column(name = "salt")
    private String salt ;

    @Column(name = "is_del")
    private Integer isDel ;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" ,timezone = "GMT+8")
    @Column(name = "create_time")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" ,timezone = "GMT+8")
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 密码盐.
     * @return
     */
    public void setCredentialsSalt(String salt){
        this.salt = salt;
    }
    public String getCredentialsSalt(){
        return this.salt;
    }

}
